<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:a="http://richfaces.org/a4j"
    template="/layout/template.xhtml">

    <ui:define name="l_content">
    	<ui:include src="/l_content/lc_hmm.xhtml" />
    </ui:define>
    
    <ui:define name="body">
    	<h:panelGroup rendered="#{!kItemListViewManager.error}">
    	<table width="100%">
    		<tr>
    			<td valign="top" >
			    	<h:form>
			    		<rich:simpleTogglePanel id="sp" switchType="client" reRender="sp" opened="false" >
			    			<f:facet name="header">
					        	<h:outputText value="#{messages.search_msg}" />
				            </f:facet>
				    		<a:commandButton id="search_" value="#{messages.search_msg}" 
				    			action="#{kItemListViewManager.search()}" reRender="a_panel_id" >
				    			<s:defaultAction />
				    		</a:commandButton>
				    		<a:commandLink value="#{!kItemListViewManager.search.advanced ? messages.advanced_msg : messages.basic_msg}" action="#{kItemListViewManager.search.swith()}" reRender="sp" style="float:right;"/>
			    			<table>
			    				<tr>
			    					<td>
			    						<h:outputLabel for="price_from" value="#{messages.price_from_msg}" />&#160;<br />
			    						<h:inputText id="price_from" value="#{kItemListViewManager.search.priceFrom}" size="4"/>    						
			    					</td>
			    					<td>
			    						<h:outputLabel for="price_to" value="#{messages.price_to_msg}" />&#160;<br />
			    						<h:inputText id="price_to" value="#{kItemListViewManager.search.priceTo}" size="4"/>    						
			    					</td>
			    					<td>
			    						<h:outputLabel for="created" value="#{messages.valid_to_msg}" />&#160;<br />
			    						<rich:calendar id="created" value="#{kItemListViewManager.search.validTo}" cellWidth="30px" cellHeight="30px" showWeeksBar="false" />    						
			    					</td>
			    				</tr>
			    				<s:fragment rendered="#{!kItemListViewManager.search.advanced}">
				    				<tr>
				    					<td>
				    						<h:outputLabel for="scolors" value="#{messages.color_msg}" />&#160;<br />
				    						<h:selectOneMenu id="scolors" value="#{kItemListViewManager.search.color}" >
				    							<s:selectItems value="#{kItemListViewManager.acolors}" var="e" label="#{e.getName(kUser.klang)}" noSelectionLabel=" " />
				    							<s:convertEntity />
				    						</h:selectOneMenu>    						
				    					</td>
				    					<td>
				    						<h:outputLabel for="ssizes" value="#{messages.size_msg}" />&#160;<br />
				    						<h:selectOneMenu id="ssizes" value="#{kItemListViewManager.search.size}" >
				    							<s:selectItems value="#{kItemListViewManager.asizes}" var="e" label="#{e.code}" noSelectionLabel=" " />
				    							<s:convertEntity />
				    						</h:selectOneMenu>    						
				    					</td>
				    					<td>
				    						<h:outputLabel for="smaterial" value="#{messages.material_msg}" />&#160;<br />
				    						<h:selectOneMenu id="smaterial" value="#{kItemListViewManager.search.material}" >
				    							<s:selectItems value="#{kItemListViewManager.amaterials}" var="e" label="#{e.getName(kUser.klang)}" noSelectionLabel=" " />
				    							<s:convertEntity />
				    						</h:selectOneMenu>    						
				    					</td>
				    				</tr>
			    				</s:fragment>
			    				<s:fragment rendered="#{kItemListViewManager.search.advanced}">
				    				<tr>
				    					<td>
				    						<h:outputLabel for="sm_colors" value="#{messages.color_msg}" />&#160;<br />
				    						<h:selectManyListbox id="sm_colors" value="#{kItemListViewManager.search.colors}" size="5" >
				    							<s:selectItems value="#{kItemListViewManager.acolors}" var="e" label="#{e.getName(kUser.klang)}" />
				    							<s:convertEntity />
				    						</h:selectManyListbox>    						
				    					</td>
				    					<td>
				    						<h:outputLabel for="sm_sizes" value="#{messages.size_msg}" />&#160;<br />
				    						<h:selectManyListbox id="sm_sizes" value="#{kItemListViewManager.search.sizes}" size="5" >
				    							<s:selectItems value="#{kItemListViewManager.asizes}" var="e" label="#{e.code}" />
				    							<s:convertEntity />
				    						</h:selectManyListbox>    						
				    					</td>
				    					<td>
				    						<h:outputLabel for="sm_material" value="#{messages.material_msg}" />&#160;<br />
				    						<h:selectManyListbox id="sm_material" value="#{kItemListViewManager.search.materials}" size="5">
				    							<s:selectItems value="#{kItemListViewManager.amaterials}" var="e" label="#{e.getName(kUser.klang)}" />
				    							<s:convertEntity />
				    						</h:selectManyListbox>    						
				    					</td>
				    				</tr>
			    				</s:fragment>
			    			</table>
			    		</rich:simpleTogglePanel>
			   			<br />    		
			    		<h:panelGroup id="a_panel_id" >
			    			<h:panelGroup styleClass="b fs16">
				   				<h:outputText value="#{messages.items_msg}" />&#160;<h:outputText value="#{kItemListViewManager.itemsHolder.modelContainer.count}" styleClass="red"/>
			    			</h:panelGroup>
			    			<h:panelGroup rendered="#{not kItemListViewManager.itemsHolder.modelContainer.isEmpty()}" >
				    			<table>
				    				<tr>
				    					<td style="padding-right: 30px;" valign="top">
				    						<h:graphicImage value="/images/k_model_library.png" width="47px" height="308px" style="position:relative; top: 100px;" />
				    					</td>
				    					<td width="18" valign="top" style="padding-bottom: 25px;">
				    						<h:panelGroup id="pgn1" rendered="#{kItemListViewManager.itemsHolder.modelContainer.pagingAvb}">
					    						<a:commandLink action="#{kItemListViewManager.itemsHolder.previous()}" reRender="a_panel_id" 
													disabled="#{!kItemListViewManager.itemsHolder.modelContainer.firstAvb}" immediate="true" styleClass="display_block">
													<h:graphicImage value="/index_htm_files/71.png" title="#{messages.prev_msg}"
							   							onmouseover="bgimg('prev_item','/kadron/index_htm_files/74.png','')"
														onmouseout="bgimg('prev_item','/kadron/index_htm_files/71.png','')" 
														styleClass="prev_item"/>
												</a:commandLink>
				    						</h:panelGroup>
				    					</td>
				    					<td width="705px" height="680px" valign="top">
							    			<a:outputPanel styleClass="no_border">
									    		<rich:dataGrid id="ut_id" columns="3" value="#{kItemListViewManager.itemsHolder.modelContainer.models}" var="e" elements="6" width="100%" align="center" >
									    			<div class="k-shirt-container">
							    						<div class="k-shirt">					    							
										    				<a href="#{facesContext.externalContext.requestContextPath}/k_item.k?itemId=#{e.item.id}" >
									                			<s:fragment rendered="#{not empty e.img.thumb}">
											                		<img src="/#{kInitParam.imgPath}/i_#{e.img.itemId}/#{e.img.thumb}" width="175px" height="234px" 
											                			style="position: relative;top: 5px;left: 8px;" />
									    						</s:fragment>
									   							<s:fragment rendered="#{empty e.img.thumb}">
									   								<h:graphicImage style="position: relative;left: 7px; top: 5px; width: 176px; height: 234px;" title="#{messages.no_image_available_msg}" value="/index_htm_files/43.png" />
									    						</s:fragment>
									    					</a>
									    					<br />
									    					<img style="position: relative;top: 9px; left: 7px; width: 176px; height: 3px;" title="" alt="" src="index_htm_files/44.png" />
								    						<div style="position: relative;top: 10px;left: 10px;width: 150px;height: 20px;background: #B3000B;" class="fs14">
											    				#{e.item.getName(klang)}
															</div>
							    						</div>
									    			</div>
									    		</rich:dataGrid>
							    			</a:outputPanel>
				    					</td>
				    					<td valign="top" style="padding-bottom: 25px;" >
				    						<h:panelGroup id="pgn2" rendered="#{kItemListViewManager.itemsHolder.modelContainer.pagingAvb}">
												<table>
													<tr>
														<td>
								    						<a:commandLink action="#{kItemListViewManager.itemsHolder.next()}" reRender="a_panel_id" 
																disabled="#{!kItemListViewManager.itemsHolder.modelContainer.lastAvb}" immediate="true" styleClass="display_block">
																<h:graphicImage value="/index_htm_files/70.png" title="#{messages.next_msg}"
																	onmouseover="bgimg('next_item','/kadron/index_htm_files/73.png','')"
																	onmouseout="bgimg('next_item','/kadron/index_htm_files/70.png','')" 
																	styleClass="next_item"/>
															</a:commandLink>
														</td>
														<a:repeat value="#{kItemListViewManager.itemsHolder.modelContainer.pages}" var="p" >
															<td class="#{p eq kItemListViewManager.itemsHolder.modelContainer.currentPage ? 'dr-dscr-act' : 'dr-dscr-inact'}"
																valign="bottom">
																<h:outputText value="#{p}" rendered="#{p eq kItemListViewManager.itemsHolder.modelContainer.currentPage}"/>
																<a:commandLink value="#{p}" action="#{kItemListViewManager.itemsHolder.show(p)}" reRender="a_panel_id" 
																	rendered="#{p ne kItemListViewManager.itemsHolder.modelContainer.currentPage}" immediate="true"
																	styleClass="inact-pag-item display_block"/>
															</td>
														</a:repeat>
													</tr>
												</table>
				    						</h:panelGroup>
				    					</td>
				    				</tr>
				    			</table>
			    			</h:panelGroup>
			    		</h:panelGroup>
			    	</h:form>
    			</td>
    		</tr>
    	</table>
    	</h:panelGroup>
    	<h:panelGroup rendered="#{kItemListViewManager.error}">
    		ERROR
    	</h:panelGroup>
    </ui:define>
</ui:composition>
